/*
 * @Author: cl
 * @Description: 
 * @Date: 2023-04-18 11:13:29
 * @LastEditTime: 2023-04-20 09:59:46
 * @FilePath: \jsnode\nestjs\naota\src\subject\subject.service.ts
 * @LastEditors: cl
 */
import { Injectable} from '@nestjs/common'
import { CreateSubjectDto } from './dto/create-subject.dto'
import { UpdateSubjectDto } from './dto/update-subject.dto'
import { Subject } from './entities/subject.entity'
import { InjectRepository } from '@nestjs/typeorm'
import { Repository } from 'typeorm'

@Injectable()
export class SubjectService {

  constructor(@InjectRepository(Subject) private readonly subject:Repository<Subject>){

  }

  create(createSubjectDto: CreateSubjectDto) {
    return 'This action adds a new subject'
  }

  async findAll() {
    const list = await this.subject.find()
    return list
  }

  findOne(id: number) {
    return `This action returns a #${id} subject`
  }

  update(id: number, updateSubjectDto: UpdateSubjectDto) {
    return `This action updates a #${id} subject`
  }

  remove(id: number) {
    return `This action removes a #${id} subject`
  }
}
